
	function getScrollTop()
{
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop)
    {
        scrollTop=document.documentElement.scrollTop;
    }
    else if(document.body)
    {
        scrollTop=document.body.scrollTop;
    }
    return scrollTop;
}
function getClientHeight()
{
    var clientHeight=0;
    if(document.body.clientHeight&&document.documentElement.clientHeight)
    {
        var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;        
    }
    else
    {
        var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;    
    }
    return clientHeight;
}
function getScrollHeight()
{
    return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}
	window.onload=function(){
  
		var i=document.getElementById("wrap");
		i.addEventListener("touchmove",function(){
			var j=window.getScrollHeight();
			var k=window.getScrollTop();
			var m=window.getClientHeight();
		 
               if (k>j-m-5) {
               	document.getElementById("icon").style.display="block";
              var obj=document.getElementById("icon");
              obj.addEventListener("touchstart",function(){
              	document.getElementById("icon").style.display="none";
              	document.documentElement.scrollTop = document.body.scrollTop =0
              })

               	}
               
               else{
               	document.getElementById("icon").style.display="none";
               }
		},true)

	}
